﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MISAPP.Classify.DataAccess
{
    public class DA_Squared2011:DA_Matrix
    {
        protected bool setTableSchema = false;

        public DA_Squared2011()
        {
            tableName = "Squared2011";
        }

        public bool Insert(string p_shtName,string p_team,string p_userID
            ,string p_pos,string p_cellValue,string p_comment)
        {
            if (setTableSchema == false)
            {
                setTableSchema = true;
                FillTableSchema(tableName);
            }
            whereList = new List<string>();
            fieldList = new List<field>();
            string sql = @"
INSERT INTO Squared2011([SheetName],[Team],[User_id],[Pos],[cellValue],[comment])
VALUES(@p_shtName,@p_team,@p_userID,@p_pos,@p_cellValue,@p_comment )";

            string[] flds = { "SheetName", "Team", "User_id", "Pos",
                                "cellValue", "comment" };
            string[] vals = { p_shtName, p_team, p_userID, p_pos, p_cellValue
                                 , p_comment };
            string[] paras = {"@p_shtName","@p_team","@p_userID","@p_pos"
                                 ,"@p_cellValue","@p_comment" };
            FillFieldList(vals, paras, flds);

            AddParameter(sql);
            int iResult = Common.DAL.ExecuteNoneQuery(cmd);
            return iResult < 0 ? false : true;
        }
    }
}
